{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Semantic Kernel 快速开始"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![](./Resources/ai-sk-add-wechat.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## 基础入门\n",
    "\n",
    "### 1. 引入 NuGet包\n",
    "作为.NET 开发者，首先需要引入最新的`Microsoft.SemanticKernel` NuGet 包。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.SemanticKernel, 1.47.0</span></li></ul></div></div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "#r \"nuget: Microsoft.SemanticKernel\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2. 引入命名空间"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [],
   "source": [
    "using Microsoft.SemanticKernel;\n",
    "using Microsoft.SemanticKernel.ChatCompletion;\n",
    "using Microsoft.SemanticKernel.TextGeneration;\n",
    "using Microsoft.Extensions.DependencyInjection;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3. 构建Kernel\n",
    "以下代码注册了聊天补全服务，实际上是注册了`IChatCompletionService`和`ITextGenerationService` 两个接口的具体实现："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Microsoft.SemanticKernel.Kernel</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Plugins</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>FunctionInvocationFilters</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>PromptRenderFilters</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>AutoFunctionInvocationFilters</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>Services</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Microsoft.Extensions.DependencyInjection.ServiceProvider</code></span></summary><div><table><thead><tr></tr></thead><tbody></tbody></table></div></details></td></tr><tr><td>Culture</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code></code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Parent</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code></code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Parent</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code></code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Parent</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code></code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Parent</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code></code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Parent</td><td></td></tr><tr><td>LCID</td><td>127</td></tr><tr><td>KeyboardLayoutId</td><td>127</td></tr><tr><td>Name</td><td></td></tr><tr><td>IetfLanguageTag</td><td></td></tr><tr><td>DisplayName</td><td>Invariant Language (Invariant Country)</td></tr><tr><td>NativeName</td><td>Invariant Language (Invariant Country)</td></tr><tr><td>EnglishName</td><td>Invariant Language (Invariant Country)</td></tr><tr><td>TwoLetterISOLanguageName</td><td>iv</td></tr><tr><td>ThreeLetterISOLanguageName</td><td>ivl</td></tr><tr><td>ThreeLetterWindowsLanguageName</td><td>IVL</td></tr><tr><td>CompareInfo</td><td>CompareInfo - </td></tr><tr><td>TextInfo</td><td>TextInfo - </td></tr><tr><td>IsNeutralCulture</td><td>False</td></tr><tr><td>CultureTypes</td><td>SpecificCultures, InstalledWin32Cultures</td></tr><tr><td>NumberFormat</td><td>System.Globalization.NumberFormatInfo</td></tr><tr><td>DateTimeFormat</td><td>System.Globalization.DateTimeFormatInfo</td></tr><tr><td>Calendar</td><td>System.Globalization.GregorianCalendar</td></tr><tr><td>OptionalCalendars</td><td>[ System.Globalization.GregorianCalendar ]</td></tr><tr><td>UseUserOverride</td><td>False</td></tr><tr><td>IsReadOnly</td><td>True</td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>KeyboardLayoutId</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IetfLanguageTag</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>DisplayName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>NativeName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>EnglishName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>TwoLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>iv</pre></div></td></tr><tr><td>ThreeLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>ivl</pre></div></td></tr><tr><td>ThreeLetterWindowsLanguageName</td><td><div class=\"dni-plaintext\"><pre>IVL</pre></div></td></tr><tr><td>CompareInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>CompareInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td></td></tr><tr><td>Version</td><td>System.Globalization.SortVersion</td></tr><tr><td>LCID</td><td>127</td></tr></tbody></table></div></details></td></tr><tr><td>TextInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>TextInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ANSICodePage</td><td>1252</td></tr><tr><td>OEMCodePage</td><td>437</td></tr><tr><td>MacCodePage</td><td>10000</td></tr><tr><td>EBCDICCodePage</td><td>37</td></tr><tr><td>LCID</td><td>127</td></tr><tr><td>CultureName</td><td></td></tr><tr><td>IsReadOnly</td><td>True</td></tr><tr><td>ListSeparator</td><td>,</td></tr><tr><td>IsRightToLeft</td><td>False</td></tr></tbody></table></div></details></td></tr><tr><td>IsNeutralCulture</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>CultureTypes</td><td><span>SpecificCultures, InstalledWin32Cultures</span></td></tr><tr><td>NumberFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.NumberFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>CurrencyDecimalDigits</td><td>2</td></tr><tr><td>CurrencyDecimalSeparator</td><td>.</td></tr><tr><td>IsReadOnly</td><td>True</td></tr><tr><td>CurrencyGroupSizes</td><td>[ 3 ]</td></tr><tr><td>NumberGroupSizes</td><td>[ 3 ]</td></tr><tr><td>PercentGroupSizes</td><td>[ 3 ]</td></tr><tr><td>CurrencyGroupSeparator</td><td>,</td></tr><tr><td>CurrencySymbol</td><td>¤</td></tr><tr><td>NaNSymbol</td><td>NaN</td></tr><tr><td>CurrencyNegativePattern</td><td>0</td></tr><tr><td>NumberNegativePattern</td><td>1</td></tr><tr><td>PercentPositivePattern</td><td>0</td></tr><tr><td>PercentNegativePattern</td><td>0</td></tr><tr><td>NegativeInfinitySymbol</td><td>-Infinity</td></tr><tr><td>NegativeSign</td><td>-</td></tr><tr><td>NumberDecimalDigits</td><td>2</td></tr><tr><td>NumberDecimalSeparator</td><td>.</td></tr><tr><td>NumberGroupSeparator</td><td>,</td></tr><tr><td>CurrencyPositivePattern</td><td>0</td></tr><tr><td>PositiveInfinitySymbol</td><td>Infinity</td></tr><tr><td>PositiveSign</td><td>+</td></tr><tr><td>PercentDecimalDigits</td><td>2</td></tr><tr><td>PercentDecimalSeparator</td><td>.</td></tr><tr><td>PercentGroupSeparator</td><td>,</td></tr><tr><td>PercentSymbol</td><td>%</td></tr><tr><td>PerMilleSymbol</td><td>‰</td></tr><tr><td>NativeDigits</td><td>[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]</td></tr><tr><td>DigitSubstitution</td><td>None</td></tr></tbody></table></div></details></td></tr><tr><td>DateTimeFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.DateTimeFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AMDesignator</td><td>AM</td></tr><tr><td>Calendar</td><td>System.Globalization.GregorianCalendar</td></tr><tr><td>DateSeparator</td><td>/</td></tr><tr><td>FirstDayOfWeek</td><td>Sunday</td></tr><tr><td>CalendarWeekRule</td><td>FirstDay</td></tr><tr><td>FullDateTimePattern</td><td>dddd, dd MMMM yyyy HH:mm:ss</td></tr><tr><td>LongDatePattern</td><td>dddd, dd MMMM yyyy</td></tr><tr><td>LongTimePattern</td><td>HH:mm:ss</td></tr><tr><td>MonthDayPattern</td><td>MMMM dd</td></tr><tr><td>PMDesignator</td><td>PM</td></tr><tr><td>RFC1123Pattern</td><td>ddd, dd MMM yyyy HH':'mm':'ss 'GMT'</td></tr><tr><td>ShortDatePattern</td><td>MM/dd/yyyy</td></tr><tr><td>ShortTimePattern</td><td>HH:mm</td></tr><tr><td>SortableDateTimePattern</td><td>yyyy'-'MM'-'dd'T'HH':'mm':'ss</td></tr><tr><td>TimeSeparator</td><td>:</td></tr><tr><td>UniversalSortableDateTimePattern</td><td>yyyy'-'MM'-'dd HH':'mm':'ss'Z'</td></tr><tr><td>YearMonthPattern</td><td>yyyy MMMM</td></tr><tr><td>AbbreviatedDayNames</td><td>[ Sun, Mon, Tue, Wed, Thu, Fri, Sat ]</td></tr><tr><td>ShortestDayNames</td><td>[ Su, Mo, Tu, We, Th, Fr, Sa ]</td></tr><tr><td>DayNames</td><td>[ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday ]</td></tr><tr><td>AbbreviatedMonthNames</td><td>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</td></tr><tr><td>MonthNames</td><td>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</td></tr><tr><td>IsReadOnly</td><td>True</td></tr><tr><td>NativeCalendarName</td><td>Gregorian Calendar</td></tr><tr><td>AbbreviatedMonthGenitiveNames</td><td>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</td></tr><tr><td>MonthGenitiveNames</td><td>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</td></tr></tbody></table></div></details></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td>1/1/0001 12:00:00 AM</td></tr><tr><td>MaxSupportedDateTime</td><td>12/31/9999 11:59:59 PM</td></tr><tr><td>AlgorithmType</td><td>SolarCalendar</td></tr><tr><td>CalendarType</td><td>Localized</td></tr><tr><td>Eras</td><td>[ 1 ]</td></tr><tr><td>TwoDigitYearMax</td><td>2049</td></tr><tr><td>IsReadOnly</td><td>True</td></tr></tbody></table></div></details></td></tr><tr><td>OptionalCalendars</td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td>System.Globalization.GregorianCalendar</td></tr></tbody></table></td></tr><tr><td>UseUserOverride</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>KeyboardLayoutId</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IetfLanguageTag</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>DisplayName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>NativeName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>EnglishName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>TwoLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>iv</pre></div></td></tr><tr><td>ThreeLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>ivl</pre></div></td></tr><tr><td>ThreeLetterWindowsLanguageName</td><td><div class=\"dni-plaintext\"><pre>IVL</pre></div></td></tr><tr><td>CompareInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>CompareInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>Version</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.SortVersion</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>FullVersion</td><td>31129</td></tr><tr><td>SortId</td><td>00007999-0000-0000-0000-00000000007f</td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>TextInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>TextInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ANSICodePage</td><td><div class=\"dni-plaintext\"><pre>1252</pre></div></td></tr><tr><td>OEMCodePage</td><td><div class=\"dni-plaintext\"><pre>437</pre></div></td></tr><tr><td>MacCodePage</td><td><div class=\"dni-plaintext\"><pre>10000</pre></div></td></tr><tr><td>EBCDICCodePage</td><td><div class=\"dni-plaintext\"><pre>37</pre></div></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>CultureName</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>ListSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>IsRightToLeft</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsNeutralCulture</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>CultureTypes</td><td><span>SpecificCultures, InstalledWin32Cultures</span></td></tr><tr><td>NumberFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.NumberFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>CurrencyDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>CurrencyDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CurrencyGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>NumberGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>PercentGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>CurrencyGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencySymbol</td><td><div class=\"dni-plaintext\"><pre>&#164;</pre></div></td></tr><tr><td>NaNSymbol</td><td><div class=\"dni-plaintext\"><pre>NaN</pre></div></td></tr><tr><td>CurrencyNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NumberNegativePattern</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>PercentPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PercentNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NegativeInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>-Infinity</pre></div></td></tr><tr><td>NegativeSign</td><td><div class=\"dni-plaintext\"><pre>-</pre></div></td></tr><tr><td>NumberDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>NumberDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>NumberGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencyPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PositiveInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>Infinity</pre></div></td></tr><tr><td>PositiveSign</td><td><div class=\"dni-plaintext\"><pre>+</pre></div></td></tr><tr><td>PercentDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>PercentDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>PercentGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>PercentSymbol</td><td><div class=\"dni-plaintext\"><pre>%</pre></div></td></tr><tr><td>PerMilleSymbol</td><td><div class=\"dni-plaintext\"><pre>‰</pre></div></td></tr><tr><td>NativeDigits</td><td><div class=\"dni-plaintext\"><pre>[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]</pre></div></td></tr><tr><td>DigitSubstitution</td><td><span>None</span></td></tr></tbody></table></div></details></td></tr><tr><td>DateTimeFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.DateTimeFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AMDesignator</td><td><div class=\"dni-plaintext\"><pre>AM</pre></div></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td>1/1/0001 12:00:00 AM</td></tr><tr><td>MaxSupportedDateTime</td><td>12/31/9999 11:59:59 PM</td></tr><tr><td>AlgorithmType</td><td>SolarCalendar</td></tr><tr><td>CalendarType</td><td>Localized</td></tr><tr><td>Eras</td><td>[ 1 ]</td></tr><tr><td>TwoDigitYearMax</td><td>2049</td></tr><tr><td>IsReadOnly</td><td>True</td></tr></tbody></table></div></details></td></tr><tr><td>DateSeparator</td><td><div class=\"dni-plaintext\"><pre>/</pre></div></td></tr><tr><td>FirstDayOfWeek</td><td><span>Sunday</span></td></tr><tr><td>CalendarWeekRule</td><td><span>FirstDay</span></td></tr><tr><td>FullDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy HH:mm:ss</pre></div></td></tr><tr><td>LongDatePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy</pre></div></td></tr><tr><td>LongTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm:ss</pre></div></td></tr><tr><td>MonthDayPattern</td><td><div class=\"dni-plaintext\"><pre>MMMM dd</pre></div></td></tr><tr><td>PMDesignator</td><td><div class=\"dni-plaintext\"><pre>PM</pre></div></td></tr><tr><td>RFC1123Pattern</td><td><div class=\"dni-plaintext\"><pre>ddd, dd MMM yyyy HH&#39;:&#39;mm&#39;:&#39;ss &#39;GMT&#39;</pre></div></td></tr><tr><td>ShortDatePattern</td><td><div class=\"dni-plaintext\"><pre>MM/dd/yyyy</pre></div></td></tr><tr><td>ShortTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm</pre></div></td></tr><tr><td>SortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd&#39;T&#39;HH&#39;:&#39;mm&#39;:&#39;ss</pre></div></td></tr><tr><td>TimeSeparator</td><td><div class=\"dni-plaintext\"><pre>:</pre></div></td></tr><tr><td>UniversalSortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd HH&#39;:&#39;mm&#39;:&#39;ss&#39;Z&#39;</pre></div></td></tr><tr><td>YearMonthPattern</td><td><div class=\"dni-plaintext\"><pre>yyyy MMMM</pre></div></td></tr><tr><td>AbbreviatedDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sun, Mon, Tue, Wed, Thu, Fri, Sat ]</pre></div></td></tr><tr><td>ShortestDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Su, Mo, Tu, We, Th, Fr, Sa ]</pre></div></td></tr><tr><td>DayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday ]</pre></div></td></tr><tr><td>AbbreviatedMonthNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>NativeCalendarName</td><td><div class=\"dni-plaintext\"><pre>Gregorian Calendar</pre></div></td></tr><tr><td>AbbreviatedMonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>OptionalCalendars</td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td>1/1/0001 12:00:00 AM</td></tr><tr><td>MaxSupportedDateTime</td><td>12/31/9999 11:59:59 PM</td></tr><tr><td>AlgorithmType</td><td>SolarCalendar</td></tr><tr><td>CalendarType</td><td>Localized</td></tr><tr><td>Eras</td><td>[ 1 ]</td></tr><tr><td>TwoDigitYearMax</td><td>2049</td></tr><tr><td>IsReadOnly</td><td>False</td></tr></tbody></table></div></details></td></tr></tbody></table></td></tr><tr><td>UseUserOverride</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>KeyboardLayoutId</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IetfLanguageTag</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>DisplayName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>NativeName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>EnglishName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>TwoLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>iv</pre></div></td></tr><tr><td>ThreeLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>ivl</pre></div></td></tr><tr><td>ThreeLetterWindowsLanguageName</td><td><div class=\"dni-plaintext\"><pre>IVL</pre></div></td></tr><tr><td>CompareInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>CompareInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>Version</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.SortVersion</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>FullVersion</td><td><div class=\"dni-plaintext\"><pre>31129</pre></div></td></tr><tr><td>SortId</td><td><div class=\"dni-plaintext\"><pre>00007999-0000-0000-0000-00000000007f</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>TextInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>TextInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ANSICodePage</td><td><div class=\"dni-plaintext\"><pre>1252</pre></div></td></tr><tr><td>OEMCodePage</td><td><div class=\"dni-plaintext\"><pre>437</pre></div></td></tr><tr><td>MacCodePage</td><td><div class=\"dni-plaintext\"><pre>10000</pre></div></td></tr><tr><td>EBCDICCodePage</td><td><div class=\"dni-plaintext\"><pre>37</pre></div></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>CultureName</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>ListSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>IsRightToLeft</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsNeutralCulture</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>CultureTypes</td><td><span>SpecificCultures, InstalledWin32Cultures</span></td></tr><tr><td>NumberFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.NumberFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>CurrencyDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>CurrencyDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CurrencyGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>NumberGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>PercentGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>CurrencyGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencySymbol</td><td><div class=\"dni-plaintext\"><pre>&#164;</pre></div></td></tr><tr><td>NaNSymbol</td><td><div class=\"dni-plaintext\"><pre>NaN</pre></div></td></tr><tr><td>CurrencyNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NumberNegativePattern</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>PercentPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PercentNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NegativeInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>-Infinity</pre></div></td></tr><tr><td>NegativeSign</td><td><div class=\"dni-plaintext\"><pre>-</pre></div></td></tr><tr><td>NumberDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>NumberDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>NumberGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencyPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PositiveInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>Infinity</pre></div></td></tr><tr><td>PositiveSign</td><td><div class=\"dni-plaintext\"><pre>+</pre></div></td></tr><tr><td>PercentDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>PercentDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>PercentGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>PercentSymbol</td><td><div class=\"dni-plaintext\"><pre>%</pre></div></td></tr><tr><td>PerMilleSymbol</td><td><div class=\"dni-plaintext\"><pre>‰</pre></div></td></tr><tr><td>NativeDigits</td><td><div class=\"dni-plaintext\"><pre>[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]</pre></div></td></tr><tr><td>DigitSubstitution</td><td><span>None</span></td></tr></tbody></table></div></details></td></tr><tr><td>DateTimeFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.DateTimeFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AMDesignator</td><td><div class=\"dni-plaintext\"><pre>AM</pre></div></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>DateSeparator</td><td><div class=\"dni-plaintext\"><pre>/</pre></div></td></tr><tr><td>FirstDayOfWeek</td><td><span>Sunday</span></td></tr><tr><td>CalendarWeekRule</td><td><span>FirstDay</span></td></tr><tr><td>FullDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy HH:mm:ss</pre></div></td></tr><tr><td>LongDatePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy</pre></div></td></tr><tr><td>LongTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm:ss</pre></div></td></tr><tr><td>MonthDayPattern</td><td><div class=\"dni-plaintext\"><pre>MMMM dd</pre></div></td></tr><tr><td>PMDesignator</td><td><div class=\"dni-plaintext\"><pre>PM</pre></div></td></tr><tr><td>RFC1123Pattern</td><td><div class=\"dni-plaintext\"><pre>ddd, dd MMM yyyy HH&#39;:&#39;mm&#39;:&#39;ss &#39;GMT&#39;</pre></div></td></tr><tr><td>ShortDatePattern</td><td><div class=\"dni-plaintext\"><pre>MM/dd/yyyy</pre></div></td></tr><tr><td>ShortTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm</pre></div></td></tr><tr><td>SortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd&#39;T&#39;HH&#39;:&#39;mm&#39;:&#39;ss</pre></div></td></tr><tr><td>TimeSeparator</td><td><div class=\"dni-plaintext\"><pre>:</pre></div></td></tr><tr><td>UniversalSortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd HH&#39;:&#39;mm&#39;:&#39;ss&#39;Z&#39;</pre></div></td></tr><tr><td>YearMonthPattern</td><td><div class=\"dni-plaintext\"><pre>yyyy MMMM</pre></div></td></tr><tr><td>AbbreviatedDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sun, Mon, Tue, Wed, Thu, Fri, Sat ]</pre></div></td></tr><tr><td>ShortestDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Su, Mo, Tu, We, Th, Fr, Sa ]</pre></div></td></tr><tr><td>DayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday ]</pre></div></td></tr><tr><td>AbbreviatedMonthNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>NativeCalendarName</td><td><div class=\"dni-plaintext\"><pre>Gregorian Calendar</pre></div></td></tr><tr><td>AbbreviatedMonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>OptionalCalendars</td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></td></tr><tr><td>UseUserOverride</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>KeyboardLayoutId</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IetfLanguageTag</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>DisplayName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>NativeName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>EnglishName</td><td><div class=\"dni-plaintext\"><pre>Invariant Language (Invariant Country)</pre></div></td></tr><tr><td>TwoLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>iv</pre></div></td></tr><tr><td>ThreeLetterISOLanguageName</td><td><div class=\"dni-plaintext\"><pre>ivl</pre></div></td></tr><tr><td>ThreeLetterWindowsLanguageName</td><td><div class=\"dni-plaintext\"><pre>IVL</pre></div></td></tr><tr><td>CompareInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>CompareInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>Version</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.SortVersion</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>FullVersion</td><td><div class=\"dni-plaintext\"><pre>31129</pre></div></td></tr><tr><td>SortId</td><td><div class=\"dni-plaintext\"><pre>00007999-0000-0000-0000-00000000007f</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>TextInfo</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>TextInfo -</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ANSICodePage</td><td><div class=\"dni-plaintext\"><pre>1252</pre></div></td></tr><tr><td>OEMCodePage</td><td><div class=\"dni-plaintext\"><pre>437</pre></div></td></tr><tr><td>MacCodePage</td><td><div class=\"dni-plaintext\"><pre>10000</pre></div></td></tr><tr><td>EBCDICCodePage</td><td><div class=\"dni-plaintext\"><pre>37</pre></div></td></tr><tr><td>LCID</td><td><div class=\"dni-plaintext\"><pre>127</pre></div></td></tr><tr><td>CultureName</td><td><div class=\"dni-plaintext\"><pre></pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>ListSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>IsRightToLeft</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsNeutralCulture</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>CultureTypes</td><td><span>SpecificCultures, InstalledWin32Cultures</span></td></tr><tr><td>NumberFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.NumberFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>CurrencyDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>CurrencyDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CurrencyGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>NumberGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>PercentGroupSizes</td><td><div class=\"dni-plaintext\"><pre>[ 3 ]</pre></div></td></tr><tr><td>CurrencyGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencySymbol</td><td><div class=\"dni-plaintext\"><pre>&#164;</pre></div></td></tr><tr><td>NaNSymbol</td><td><div class=\"dni-plaintext\"><pre>NaN</pre></div></td></tr><tr><td>CurrencyNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NumberNegativePattern</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>PercentPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PercentNegativePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>NegativeInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>-Infinity</pre></div></td></tr><tr><td>NegativeSign</td><td><div class=\"dni-plaintext\"><pre>-</pre></div></td></tr><tr><td>NumberDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>NumberDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>NumberGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>CurrencyPositivePattern</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>PositiveInfinitySymbol</td><td><div class=\"dni-plaintext\"><pre>Infinity</pre></div></td></tr><tr><td>PositiveSign</td><td><div class=\"dni-plaintext\"><pre>+</pre></div></td></tr><tr><td>PercentDecimalDigits</td><td><div class=\"dni-plaintext\"><pre>2</pre></div></td></tr><tr><td>PercentDecimalSeparator</td><td><div class=\"dni-plaintext\"><pre>.</pre></div></td></tr><tr><td>PercentGroupSeparator</td><td><div class=\"dni-plaintext\"><pre>,</pre></div></td></tr><tr><td>PercentSymbol</td><td><div class=\"dni-plaintext\"><pre>%</pre></div></td></tr><tr><td>PerMilleSymbol</td><td><div class=\"dni-plaintext\"><pre>‰</pre></div></td></tr><tr><td>NativeDigits</td><td><div class=\"dni-plaintext\"><pre>[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]</pre></div></td></tr><tr><td>DigitSubstitution</td><td><span>None</span></td></tr></tbody></table></div></details></td></tr><tr><td>DateTimeFormat</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.DateTimeFormatInfo</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AMDesignator</td><td><div class=\"dni-plaintext\"><pre>AM</pre></div></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>DateSeparator</td><td><div class=\"dni-plaintext\"><pre>/</pre></div></td></tr><tr><td>FirstDayOfWeek</td><td><span>Sunday</span></td></tr><tr><td>CalendarWeekRule</td><td><span>FirstDay</span></td></tr><tr><td>FullDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy HH:mm:ss</pre></div></td></tr><tr><td>LongDatePattern</td><td><div class=\"dni-plaintext\"><pre>dddd, dd MMMM yyyy</pre></div></td></tr><tr><td>LongTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm:ss</pre></div></td></tr><tr><td>MonthDayPattern</td><td><div class=\"dni-plaintext\"><pre>MMMM dd</pre></div></td></tr><tr><td>PMDesignator</td><td><div class=\"dni-plaintext\"><pre>PM</pre></div></td></tr><tr><td>RFC1123Pattern</td><td><div class=\"dni-plaintext\"><pre>ddd, dd MMM yyyy HH&#39;:&#39;mm&#39;:&#39;ss &#39;GMT&#39;</pre></div></td></tr><tr><td>ShortDatePattern</td><td><div class=\"dni-plaintext\"><pre>MM/dd/yyyy</pre></div></td></tr><tr><td>ShortTimePattern</td><td><div class=\"dni-plaintext\"><pre>HH:mm</pre></div></td></tr><tr><td>SortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd&#39;T&#39;HH&#39;:&#39;mm&#39;:&#39;ss</pre></div></td></tr><tr><td>TimeSeparator</td><td><div class=\"dni-plaintext\"><pre>:</pre></div></td></tr><tr><td>UniversalSortableDateTimePattern</td><td><div class=\"dni-plaintext\"><pre>yyyy&#39;-&#39;MM&#39;-&#39;dd HH&#39;:&#39;mm&#39;:&#39;ss&#39;Z&#39;</pre></div></td></tr><tr><td>YearMonthPattern</td><td><div class=\"dni-plaintext\"><pre>yyyy MMMM</pre></div></td></tr><tr><td>AbbreviatedDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sun, Mon, Tue, Wed, Thu, Fri, Sat ]</pre></div></td></tr><tr><td>ShortestDayNames</td><td><div class=\"dni-plaintext\"><pre>[ Su, Mo, Tu, We, Th, Fr, Sa ]</pre></div></td></tr><tr><td>DayNames</td><td><div class=\"dni-plaintext\"><pre>[ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday ]</pre></div></td></tr><tr><td>AbbreviatedMonthNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>NativeCalendarName</td><td><div class=\"dni-plaintext\"><pre>Gregorian Calendar</pre></div></td></tr><tr><td>AbbreviatedMonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec,  ]</pre></div></td></tr><tr><td>MonthGenitiveNames</td><td><div class=\"dni-plaintext\"><pre>[ January, February, March, April, May, June, July, August, September, October, November, December,  ]</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>Calendar</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>OptionalCalendars</td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Globalization.GregorianCalendar</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>MinSupportedDateTime</td><td><span>0001-01-01 00:00:00Z</span></td></tr><tr><td>MaxSupportedDateTime</td><td><span>9999-12-31 23:59:59Z</span></td></tr><tr><td>AlgorithmType</td><td><span>SolarCalendar</span></td></tr><tr><td>CalendarType</td><td><span>Localized</span></td></tr><tr><td>Eras</td><td><div class=\"dni-plaintext\"><pre>[ 1 ]</pre></div></td></tr><tr><td>TwoDigitYearMax</td><td><div class=\"dni-plaintext\"><pre>2049</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></td></tr><tr><td>UseUserOverride</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>LoggerFactory</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Microsoft.Extensions.Logging.Abstractions.NullLoggerFactory</code></span></summary><div><table><thead><tr></tr></thead><tbody></tbody></table></div></details></td></tr><tr><td>ServiceSelector</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Microsoft.SemanticKernel.Services.OrderedAIServiceSelector</code></span></summary><div><table><thead><tr></tr></thead><tbody></tbody></table></div></details></td></tr><tr><td>Data</td><td><i>(empty)</i></td></tr></tbody></table></div></details><style>\r\n",
       ".dni-code-hint {\r\n",
       "    font-style: italic;\r\n",
       "    overflow: hidden;\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview {\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview td {\r\n",
       "    vertical-align: top;\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "details.dni-treeview {\r\n",
       "    padding-left: 1em;\r\n",
       "}\r\n",
       "table td {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "table tr { \r\n",
       "    vertical-align: top; \r\n",
       "    margin: 0em 0px;\r\n",
       "}\r\n",
       "table tr td pre \r\n",
       "{ \r\n",
       "    vertical-align: top !important; \r\n",
       "    margin: 0em 0px !important;\r\n",
       "} \r\n",
       "table th {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "</style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "// Create kernel builder\n",
    "var builder = Kernel.CreateBuilder();\n",
    "// Add OpenAI chat completion\n",
    "// builder.AddOpenAIChatCompletion(\n",
    "//     modelId: \"YOUR_MODEL_ID\",\n",
    "//     apiKey: \"YOUR_API_KEY\");\n",
    "// Add Azure OpenAI chat completion\n",
    "builder.AddAzureOpenAIChatCompletion(\n",
    "    deploymentName:\"gpt-4o\",\n",
    "    endpoint:\"https://my-openapi.openai.azure.com/\",\n",
    "    apiKey: \"163ed6f8bc2947e0906d6ee5e173a222\");\n",
    "// Build kernel\n",
    "var kernel = builder.Build();\n",
    "\n",
    "kernel.Display();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4. 使用聊天补全服务构建会话"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用`ITextGenerationService`："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>是啊，今天天气很好，适合出去走走或者进行一些户外活动。享受这样的好天气吧！你有什么特别的计划吗？</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Text</td><td><div class=\"dni-plaintext\"><pre>是啊，今天天气很好，适合出去走走或者进行一些户外活动。享受这样的好天气吧！你有什么特别的计划吗？</pre></div></td></tr><tr><td>Encoding</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.UTF8Encoding+UTF8EncodingSealed</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Preamble</td><td><div class=\"dni-plaintext\"><pre>System.Text.UTF8Encoding+UTF8EncodingSealed</pre></div></td></tr><tr><td>BodyName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>EncodingName</td><td><div class=\"dni-plaintext\"><pre>Unicode (UTF-8)</pre></div></td></tr><tr><td>HeaderName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WebName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WindowsCodePage</td><td><div class=\"dni-plaintext\"><pre>1200</pre></div></td></tr><tr><td>IsBrowserDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsBrowserSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsSingleByte</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>EncoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.EncoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>DecoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.DecoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CodePage</td><td><div class=\"dni-plaintext\"><pre>65001</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>MimeType</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>InnerContent</td><td><div class=\"dni-plaintext\"><pre>是啊，今天天气很好，适合出去走走或者进行一些户外活动。享受这样的好天气吧！你有什么特别的计划吗？</pre></div></td></tr><tr><td>ModelId</td><td><div class=\"dni-plaintext\"><pre>gpt-4o</pre></div></td></tr><tr><td>Metadata</td><td><table><thead><tr><th><i>key</i></th><th><i>type</i></th><th>value</th></tr></thead><tbody><tr><td><div class=\"dni-plaintext\"><pre>Id</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>chatcmpl-BO0ywVTpZZXKHlj9J1PtQ7vomdeXW</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>CreatedAt</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.datetimeoffset?view=net-7.0\">System.DateTimeOffset</a></span></td><td><span>2025-04-19 11:49:06Z</span></td></tr><tr><td><div class=\"dni-plaintext\"><pre>SystemFingerprint</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>fp_ee1d74bde0</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>Usage</pre></div></td><td>OpenAI.Chat.ChatTokenUsage</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatTokenUsage</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>OutputTokenCount</td><td><div class=\"dni-plaintext\"><pre>35</pre></div></td></tr><tr><td>InputTokenCount</td><td><div class=\"dni-plaintext\"><pre>12</pre></div></td></tr><tr><td>TotalTokenCount</td><td><div class=\"dni-plaintext\"><pre>47</pre></div></td></tr><tr><td>OutputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatOutputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ReasoningTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AcceptedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>RejectedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>InputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatInputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>CachedTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></div></details></td></tr><tr><td><div class=\"dni-plaintext\"><pre>Refusal</pre></div></td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>FinishReason</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>Stop</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>ContentTokenLogProbabilities</pre></div></td><td>OpenAI.ChangeTrackingList&lt;OpenAI.Chat.ChatTokenLogProbabilityDetails&gt;</td><td></td></tr></tbody></table></td></tr></tbody></table></div></details><style>\r\n",
       ".dni-code-hint {\r\n",
       "    font-style: italic;\r\n",
       "    overflow: hidden;\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview {\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview td {\r\n",
       "    vertical-align: top;\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "details.dni-treeview {\r\n",
       "    padding-left: 1em;\r\n",
       "}\r\n",
       "table td {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "table tr { \r\n",
       "    vertical-align: top; \r\n",
       "    margin: 0em 0px;\r\n",
       "}\r\n",
       "table tr td pre \r\n",
       "{ \r\n",
       "    vertical-align: top !important; \r\n",
       "    margin: 0em 0px !important;\r\n",
       "} \r\n",
       "table th {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "</style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "// get text generation service\n",
    "var textGenerationService = kernel.Services.GetRequiredService<ITextGenerationService>();\n",
    "\n",
    "var text = await textGenerationService.GetTextContentAsync(\"今天天气不错，\");\n",
    "\n",
    "text.Display();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "也可以使用`IChatCompletionService`："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, f...</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ToolCalls</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>IsUndefined</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>AuthorName</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>Role</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Assistant</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Label</td><td><div class=\"dni-plaintext\"><pre>Assistant</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>Content</td><td><div class=\"dni-plaintext\"><pre>Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, facilitating the creation of intelligent applications.\n",
       "\n",
       "Key features of Semantic Kernel include:\n",
       "\n",
       "1. **Modularity**: It allows developers to build applications in a modular manner where AI skills and plugins can be integrated, managed, and executed easily.\n",
       "\n",
       "2. **Extensibility**: Developers can extend the framework by adding custom AI models, skills, or connecting it to external data sources.\n",
       "\n",
       "3. **Interoperability**: Semantic Kernel can work with different AI models and platforms, enabling developers to use the best suited tools and technologies for their applications.\n",
       "\n",
       "4. **Ease of Use**: The framework is designed to be developer-friendly, providing simple APIs and documentation to make it accessible for those looking to integrate AI into their software without extensive knowledge of AI techniques.\n",
       "\n",
       "Overall, Semantic Kernel helps bridge the gap between AI technologies and practical application development by simplifying the integration process and enhancing the capabilities of applications through intelligent features.</pre></div></td></tr><tr><td>Items</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[ Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, facilitating the creation of intelligent applications.\n",
       "\n",
       "Key features of Semantic Kernel include:\n",
       "\n",
       "1. **Modularity**: It allows developers to build applications in a modular manner where AI skills and plugins can be integrated, managed, and executed easily.\n",
       "\n",
       "2. **Extensibility**: Developers can extend the framework by adding custom AI models, skills, or connecting it to external data sources.\n",
       "\n",
       "3. **Interoperability**: Semantic Kernel can work with different AI models and platforms, enabling developers to use the best suited tools and technologies for their applications.\n",
       "\n",
       "4. **Ease of Use**: The framework is designed to be developer-friendly, providing simple APIs and documentation to make it accessible for those looking to integrate AI into their software without extensive knowledge of AI techniques.\n",
       "\n",
       "Overall, Semantic Kernel helps bridge the gap between AI technologies and practical application development by simplifying the integration process and enhancing the capabilities of applications through intelligent features. ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td><i>(values)</i></td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, f...</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Text</td><td><div class=\"dni-plaintext\"><pre>Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, facilitating the creation of intelligent applications.\n",
       "\n",
       "Key features of Semantic Kernel include:\n",
       "\n",
       "1. **Modularity**: It allows developers to build applications in a modular manner where AI skills and plugins can be integrated, managed, and executed easily.\n",
       "\n",
       "2. **Extensibility**: Developers can extend the framework by adding custom AI models, skills, or connecting it to external data sources.\n",
       "\n",
       "3. **Interoperability**: Semantic Kernel can work with different AI models and platforms, enabling developers to use the best suited tools and technologies for their applications.\n",
       "\n",
       "4. **Ease of Use**: The framework is designed to be developer-friendly, providing simple APIs and documentation to make it accessible for those looking to integrate AI into their software without extensive knowledge of AI techniques.\n",
       "\n",
       "Overall, Semantic Kernel helps bridge the gap between AI technologies and practical application development by simplifying the integration process and enhancing the capabilities of applications through intelligent features.</pre></div></td></tr><tr><td>Encoding</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.UTF8Encoding+UTF8EncodingSealed</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Preamble</td><td><div class=\"dni-plaintext\"><pre>System.Text.UTF8Encoding+UTF8EncodingSealed</pre></div></td></tr><tr><td>BodyName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>EncodingName</td><td><div class=\"dni-plaintext\"><pre>Unicode (UTF-8)</pre></div></td></tr><tr><td>HeaderName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WebName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WindowsCodePage</td><td><div class=\"dni-plaintext\"><pre>1200</pre></div></td></tr><tr><td>IsBrowserDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsBrowserSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsSingleByte</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>EncoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.EncoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>DecoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.DecoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CodePage</td><td><div class=\"dni-plaintext\"><pre>65001</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>MimeType</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>InnerContent</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>ModelId</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>Metadata</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></td></tr></tbody></table></div></details></td></tr><tr><td>Encoding</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.UTF8Encoding+UTF8EncodingSealed</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Preamble</td><td><div class=\"dni-plaintext\"><pre>System.Text.UTF8Encoding+UTF8EncodingSealed</pre></div></td></tr><tr><td>BodyName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>EncodingName</td><td><div class=\"dni-plaintext\"><pre>Unicode (UTF-8)</pre></div></td></tr><tr><td>HeaderName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WebName</td><td><div class=\"dni-plaintext\"><pre>utf-8</pre></div></td></tr><tr><td>WindowsCodePage</td><td><div class=\"dni-plaintext\"><pre>1200</pre></div></td></tr><tr><td>IsBrowserDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsBrowserSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsDisplay</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsMailNewsSave</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>IsSingleByte</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td>EncoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.EncoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>DecoderFallback</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>System.Text.DecoderReplacementFallback</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>DefaultString</td><td><div class=\"dni-plaintext\"><pre>�</pre></div></td></tr><tr><td>MaxCharCount</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>CodePage</td><td><div class=\"dni-plaintext\"><pre>65001</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>Source</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>MimeType</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>InnerContent</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatCompletion</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>CreatedAt</td><td><span>2025-04-19 11:50:10Z</span></td></tr><tr><td>FinishReason</td><td><span>Stop</span></td></tr><tr><td>ContentTokenLogProbabilities</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>IsUndefined</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>RefusalTokenLogProbabilities</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>IsUndefined</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>Role</td><td><span>Assistant</span></td></tr><tr><td>Content</td><td><table><thead><tr><th><i>index</i></th><th>value</th></tr></thead><tbody><tr><td>0</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatMessageContentPart</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Kind</td><td><span>Text</span></td></tr><tr><td>Text</td><td><div class=\"dni-plaintext\"><pre>Semantic Kernel is an open-source framework developed by Microsoft that aims to simplify the integration of artificial intelligence capabilities, particularly large language models, into applications. It provides tools and APIs that help developers leverage AI models in a modular and flexible way, facilitating the creation of intelligent applications.\n",
       "\n",
       "Key features of Semantic Kernel include:\n",
       "\n",
       "1. **Modularity**: It allows developers to build applications in a modular manner where AI skills and plugins can be integrated, managed, and executed easily.\n",
       "\n",
       "2. **Extensibility**: Developers can extend the framework by adding custom AI models, skills, or connecting it to external data sources.\n",
       "\n",
       "3. **Interoperability**: Semantic Kernel can work with different AI models and platforms, enabling developers to use the best suited tools and technologies for their applications.\n",
       "\n",
       "4. **Ease of Use**: The framework is designed to be developer-friendly, providing simple APIs and documentation to make it accessible for those looking to integrate AI into their software without extensive knowledge of AI techniques.\n",
       "\n",
       "Overall, Semantic Kernel helps bridge the gap between AI technologies and practical application development by simplifying the integration process and enhancing the capabilities of applications through intelligent features.</pre></div></td></tr><tr><td>ImageUri</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>ImageBytes</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>ImageBytesMediaType</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>InputAudioBytes</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>InputAudioFormat</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>FileId</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>FileBytes</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>FileBytesMediaType</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>Filename</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>ImageDetailLevel</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>Refusal</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></td></tr><tr><td>ToolCalls</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>[  ]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>IsUndefined</td><td><div class=\"dni-plaintext\"><pre>True</pre></div></td></tr><tr><td>Count</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>IsReadOnly</td><td><div class=\"dni-plaintext\"><pre>False</pre></div></td></tr><tr><td><i>(values)</i></td><td><i>(empty)</i></td></tr></tbody></table></div></details></td></tr><tr><td>Refusal</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>FunctionCall</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>OutputAudio</td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td>Annotations</td><td><i>(empty)</i></td></tr><tr><td>Id</td><td><div class=\"dni-plaintext\"><pre>chatcmpl-BO0zyxk0Hkuf5EdXUY9NSb8iZ4LEc</pre></div></td></tr><tr><td>Model</td><td><div class=\"dni-plaintext\"><pre>gpt-4o-2024-08-06</pre></div></td></tr><tr><td>SystemFingerprint</td><td><div class=\"dni-plaintext\"><pre>fp_ee1d74bde0</pre></div></td></tr><tr><td>Usage</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatTokenUsage</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>OutputTokenCount</td><td><div class=\"dni-plaintext\"><pre>228</pre></div></td></tr><tr><td>InputTokenCount</td><td><div class=\"dni-plaintext\"><pre>11</pre></div></td></tr><tr><td>TotalTokenCount</td><td><div class=\"dni-plaintext\"><pre>239</pre></div></td></tr><tr><td>OutputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatOutputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ReasoningTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AcceptedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>RejectedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>InputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatInputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>CachedTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></div></details></td></tr></tbody></table></div></details></td></tr><tr><td>ModelId</td><td><div class=\"dni-plaintext\"><pre>gpt-4o</pre></div></td></tr><tr><td>Metadata</td><td><table><thead><tr><th><i>key</i></th><th><i>type</i></th><th>value</th></tr></thead><tbody><tr><td><div class=\"dni-plaintext\"><pre>Id</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>chatcmpl-BO0zyxk0Hkuf5EdXUY9NSb8iZ4LEc</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>CreatedAt</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.datetimeoffset?view=net-7.0\">System.DateTimeOffset</a></span></td><td><span>2025-04-19 11:50:10Z</span></td></tr><tr><td><div class=\"dni-plaintext\"><pre>SystemFingerprint</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>fp_ee1d74bde0</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>Usage</pre></div></td><td>OpenAI.Chat.ChatTokenUsage</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatTokenUsage</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>OutputTokenCount</td><td><div class=\"dni-plaintext\"><pre>228</pre></div></td></tr><tr><td>InputTokenCount</td><td><div class=\"dni-plaintext\"><pre>11</pre></div></td></tr><tr><td>TotalTokenCount</td><td><div class=\"dni-plaintext\"><pre>239</pre></div></td></tr><tr><td>OutputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatOutputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>ReasoningTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>AcceptedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>RejectedPredictionTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr><tr><td>InputTokenDetails</td><td><details class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>OpenAI.Chat.ChatInputTokenUsageDetails</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>AudioTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>CachedTokenCount</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr></tbody></table></div></details></td></tr></tbody></table></div></details></td></tr><tr><td><div class=\"dni-plaintext\"><pre>Refusal</pre></div></td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td><td><div class=\"dni-plaintext\"><pre>&lt;null&gt;</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>FinishReason</pre></div></td><td><span><a href=\"https://docs.microsoft.com/dotnet/api/system.string?view=net-7.0\">System.String</a></span></td><td><div class=\"dni-plaintext\"><pre>Stop</pre></div></td></tr><tr><td><div class=\"dni-plaintext\"><pre>ContentTokenLogProbabilities</pre></div></td><td>OpenAI.ChangeTrackingList&lt;OpenAI.Chat.ChatTokenLogProbabilityDetails&gt;</td><td></td></tr></tbody></table></td></tr></tbody></table></div></details><style>\r\n",
       ".dni-code-hint {\r\n",
       "    font-style: italic;\r\n",
       "    overflow: hidden;\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview {\r\n",
       "    white-space: nowrap;\r\n",
       "}\r\n",
       ".dni-treeview td {\r\n",
       "    vertical-align: top;\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "details.dni-treeview {\r\n",
       "    padding-left: 1em;\r\n",
       "}\r\n",
       "table td {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "table tr { \r\n",
       "    vertical-align: top; \r\n",
       "    margin: 0em 0px;\r\n",
       "}\r\n",
       "table tr td pre \r\n",
       "{ \r\n",
       "    vertical-align: top !important; \r\n",
       "    margin: 0em 0px !important;\r\n",
       "} \r\n",
       "table th {\r\n",
       "    text-align: start;\r\n",
       "}\r\n",
       "</style>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "// Get chat completion service\n",
    "var chatCompletionService = kernel.Services.GetRequiredService<IChatCompletionService>();\n",
    "\n",
    "var message = \"What's Semantic Kernel?\";\n",
    "var response = await chatCompletionService.GetChatMessageContentAsync(message);\n",
    "\n",
    "response.Display();"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 5. 连续会话并保存会话历史\n",
    "由于大模型是没有记忆的，因此对于需要上下文信息的多次对话而言，我们需要将聊天历史保存以便将其作为上下文发送给大模型。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You:什么是SK？\n",
      "AI:\"SK\" 可以指代多种事物，具体取决于上下文。以下是一些可能的解释：\n",
      "\n",
      "1. **国家代码**：在国际标准化组织的国家代码 ISO 3166-1 中，SK 代表斯洛伐克。\n",
      "\n",
      "2. **运动品牌**：在体育界，\"SK\" 有时可以指 \"Sportklub\" 的缩写，这通常用于欧洲一些体育俱乐部的名字。\n",
      "\n",
      "3. **科学和技术**：在技术领域，\"SK\" 可能是指某种特定的技术、公司或产品的简称。\n",
      "\n",
      "4. **流行文化**：在一些特定的文化或娱乐圈中，\"SK\" 可能是某个名人、音乐团体或作品的简称。\n",
      "\n",
      "5. **韩国公司**：在商业上，\"SK\" 是一家韩国大型企业集团，旗下有许多子公司，如 SK 电讯和 SK 海力士。\n",
      "\n",
      "如果你能提供更多背景信息，我可以给出更具体的答案。\n",
      "You:SK的全称是Semantic kernel，是微软开源的一个AI 开发框架\n",
      "AI:谢谢你的澄清。在这种情况下，SK 确实指的是 Semantic Kernel，它是由微软开源的一个用于构建和集成人工智能应用的开发框架。Semantic Kernel 提供了一些工具和功能，帮助开发者更轻松地构建和扩展 AI 驱动的解决方案。这个框架可以简化处理自然语言处理、机器学习等任务的过程，使开发者能够更加专注于创建有价值的应用，而不必担心实现底层复杂的技术细节。\n",
      "\n",
      "如果你对这一框架有特定的兴趣或问题，可以提供更多信息，以便我更好地帮助你。\n",
      "You:SK包含哪些核心构造块？\n",
      "AI:Semantic Kernel (SK) 作为一个微软开源的 AI 开发框架，包含了一些核心构造块，旨在帮助开发者构建高效的 AI 驱动应用程序。以下是一些关键的构造块：\n",
      "\n",
      "1. **内核 (Kernel)**：核心的执行引擎，负责协调和执行不同的任务和服务。它管理着应用的整体工作流程。\n",
      "\n",
      "2. **技能 (Skills)**：可复用的任务或功能模块，这些技能可以是预定义的，也可以是用户自定义的，用于实现特定的功能或任务。\n",
      "\n",
      "3. **插件 (Plugins)**：扩展内核功能的小组件，允许用户集成第三方服务或添加新的能力。\n",
      "\n",
      "4. **内存 (Memory)**：处理短期和长期记忆存储的机制，使应用能够在一定时间范围内上下文化处理数据。\n",
      "\n",
      "5. **连接器 (Connectors)**：用于与外部系统或服务进行通信的接口，例如数据库、API 或其他数据源。\n",
      "\n",
      "6. **规划器 (Planners)**：用于智能地安排和执行任务顺序的模块，确保高效的资源使用和任务完成。\n",
      "\n",
      "7. **日志和调试 (Logging and Debugging)**：内置的工具集，用于监控、记录和调试应用程序运行时的行为和错误。\n",
      "\n",
      "通过这些构造块，开发者能够更加方便地构建复杂的 AI 应用，并将其与现有系统进行无缝集成。具体的实现和功能可能会随着版本更新有所变化，因此始终参考官方文档以获取最新信息是一个好主意。\n"
     ]
    }
   ],
   "source": [
    "// 引入交互式的内核命名空间，以便用户输入\n",
    "using PolyglotKernel= Microsoft.DotNet.Interactive.Kernel;\n",
    "\n",
    "// Get chat completion service\n",
    "var chatCompletionService = kernel.Services.GetRequiredService<IChatCompletionService>();\n",
    "// Create chat history\n",
    "var chatHistory = new ChatHistory();\n",
    "while (true)\n",
    "{   \n",
    "    // Get input from user\n",
    "    var message = await PolyglotKernel.GetInputAsync(\"input something or enter bye to exit ...\");    \n",
    "    if (string.IsNullOrEmpty(message)\n",
    "        || message.Equals(\"bye\", StringComparison.OrdinalIgnoreCase))\n",
    "    {\n",
    "        break;\n",
    "    }\n",
    "    \n",
    "    Console.WriteLine($\"You:{message}\");\n",
    "    // Add user message to chat history \n",
    "    chatHistory.AddUserMessage(message);\n",
    "    // Get response from chat completion service with history\n",
    "    var response = await chatCompletionService.GetChatMessageContentAsync(chatHistory);\n",
    "    Console.WriteLine($\"AI:{response.Content}\");\n",
    "    // Add AI response to chat history\n",
    "    chatHistory.AddAssistantMessage(response.Content);\n",
    "    // response.Display();\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 6. 使用打字机效果(流式输出)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "dotnet_interactive": {
     "language": "csharp"
    },
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You: 一句话介绍微软开源项目Semantic Kernel\n",
      "Assistant: 微软开源项目Semantic Kernel是一个用于构建和运行可扩展、语义驱动的人工智能应用程序的框架，帮助开发者在不同平台上集成和利用大型语言模型。"
     ]
    }
   ],
   "source": [
    "// Get chat completion service\n",
    "var chatCompletionService = kernel.Services.GetRequiredService<IChatCompletionService>();\n",
    "\n",
    "var message = \"一句话介绍微软开源项目Semantic Kernel\";\n",
    "Console.WriteLine($\"You: {message}\");\n",
    "// Get response from chat completion service     \n",
    "var chatResult = chatCompletionService.GetStreamingChatMessageContentsAsync(message);\n",
    "string response = \"\";\n",
    "await foreach (var chunk in chatResult)\n",
    "{\n",
    "    if (chunk.Role.HasValue) Console.Write(chunk.Role + \": \");\n",
    "    response += chunk;\n",
    "    await Task.Delay(100);\n",
    "    Console.Write(chunk);\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 十行代码构建AI英语外教\n",
    "\n",
    "下面就来准备了一个简单的AI应用示例：使用SK开发专属AI外教应用。需求很简单：设计一个AI外教7*24陪我练习英语口语。\n",
    "\n",
    "### 需求分析\n",
    "\n",
    "作为一名哑巴英语保持者，目前开口的难点无外乎：\n",
    "\n",
    "* 词汇量不足\n",
    "* 语法混淆\n",
    "* 发音不准\n",
    "* 口语表达能力弱\n",
    "\n",
    "针对这些顽疾，我希望我的AI外教有这样的能力：\n",
    "\n",
    "* 由于我的词汇量不足，因此我的表达中会中英混合，当出现这种情况时，希望AI能告诉我正确的英文表达。\n",
    "* 由于我的语法经常会犯一些语法错误，当出现这种情况时，AI能及时进行语法纠正。\n",
    "* 由于我的词汇量不足，当我要求解释某些句子或单词时，希望AI能通过中文向我解释。\n",
    "* 由于有些单词不会发音，当我询问时，希望AI能以中文的形式告诉我发音技巧。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 代码实现\n",
    "\n",
    "对于以上简单的业务场景，在AI 时代只要进行简单的Prompt设计，和少许样本的支撑，即可达到不错的效果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [],
   "source": [
    "var prompt = \"\"\"\n",
    "你是一名专业的英语口语教练，请帮助我练习英语口语。\n",
    "* 由于我的词汇量不足，因此我的表达中会中英混合，当出现这种情况时，请告诉我正确的英语表达。\n",
    "* 由于我的语法薄弱，当表达出现语法错误时，请及时进行语法纠正。\n",
    "* 由于我的词汇量不足，当我要求解释某些句子或单词时，请通过中文向我解释。\n",
    "* 由于有些单词不会发音，当我询问时，请以中文的形式告诉我发音技巧。比如对于单词`ambulance`，的中文发音是`安比卢恩斯`。\n",
    "\"\"\";"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "polyglot_notebook": {
     "kernelName": "csharp"
    },
    "vscode": {
     "languageId": "polyglot-notebook"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "You:Hi, How are you?\n",
      "AI:I'm good, thank you! How about you? How has your day been so far?\n",
      "You:I am a little 郁闷\n",
      "AI:It sounds like you're feeling a bit \"down\" or \"upset.\" You can say \"I am a little down\" or \"I am a bit upset.\" Do you want to talk about what's causing you to feel this way?\n",
      "You:do you know about Semantic Kernel?\n",
      "AI:Yes, I do. The Semantic Kernel is a concept in computer science related to natural language processing and understanding. It involves creating a representation of the meaning (semantics) of words and phrases to facilitate better understanding and processing of human language by computers. If you have specific questions about it or need a more detailed explanation, feel free to ask!\n",
      "You:representation  是什么意思？\n",
      "AI:\"Representation\" 在中文中是指“表示”或“表现”。在这个上下文中，\"representation\" 指的是如何通过某种方式来呈现或表达一种事物的特征或性质，例如用某种数据结构来表示语言的意义。\n",
      "You:这个单词如何发音呢？\n",
      "AI:\"Representation\" 的中文发音可以记为：瑞普瑞森特耶逊。你可以慢慢分为几个部分来练习：瑞 / 普瑞 / 森 / 特耶 / 逊。\n",
      "You:Ok, thanks you\n",
      "AI:It looks like there was a small mistake in your sentence. The correct sentence should be \"Okay, thank you.\" Let me know if there's anything else you'd like to work on or practice!\n"
     ]
    }
   ],
   "source": [
    "// 引入交互式的内核命名空间，以便用户输入\n",
    "using PolyglotKernel= Microsoft.DotNet.Interactive.Kernel;\n",
    "\n",
    "// Get chat completion service\n",
    "var chatCompletionService = kernel.Services.GetRequiredService<IChatCompletionService>();\n",
    "// Create chat history\n",
    "var chatHistory = new ChatHistory();\n",
    "chatHistory.AddSystemMessage(prompt);\n",
    "while (true)\n",
    "{   \n",
    "    // Get input from user\n",
    "    var message = await PolyglotKernel.GetInputAsync(\"input something or enter bye to exit ...\");    \n",
    "    if (string.IsNullOrEmpty(message)\n",
    "        || message.Equals(\"bye\", StringComparison.OrdinalIgnoreCase))\n",
    "    {\n",
    "        break;\n",
    "    }\n",
    "    \n",
    "    Console.WriteLine($\"You:{message}\");\n",
    "    // Add user message to chat history \n",
    "    chatHistory.AddUserMessage(message);\n",
    "    // Get response from chat completion service with history\n",
    "    var response = await chatCompletionService.GetChatMessageContentAsync(chatHistory);\n",
    "    Console.WriteLine($\"AI:{response.Content}\");\n",
    "    // Add AI response to chat history\n",
    "    chatHistory.AddAssistantMessage(response.Content);\n",
    "}"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".NET (C#)",
   "language": "C#",
   "name": ".net-csharp"
  },
  "language_info": {
   "name": "csharp"
  },
  "polyglot_notebook": {
   "kernelInfo": {
    "defaultKernelName": "csharp",
    "items": [
     {
      "aliases": [],
      "name": "csharp"
     }
    ]
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
